<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:r="http://ricchieri.com/facelets"
	xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
<h:body>
	<ui:composition template="../../templates/commonLayoutOther.xhtml">
	<ui:define name="title">#{msg.titleOther}</ui:define>
		<ui:define name="content">
			<f:event type="preRenderView" listener="#{viewUserAccountStateMB.init}" />
			<h2>#{msg.passengerData}</h2>
			<r:viewUser manageBean="#{viewUserAccountStateMB}" user="#{viewUserAccountStateMB.user}"  showRoles="false" showEmail="false" showPhone="false"/>
			<h:form id="viewAccount">						
				<p:blockUI block="operationTable" trigger="operationTable">  
				        #{msg.loading}<br />  
					<p:graphicImage value="/images/ajax-loader.gif"/>  
				</p:blockUI>
			
				<p:dataTable var="operation" value="#{viewUserAccountStateMB.userAccountStateLazyDataModel}" 
	     	 	    id="operationTable"
	     	 		style="padding-top:15px" paginator="true" lazy="true"
	     	 		rows="10"
	     	 		paginatorPosition="bottom" emptyMessage="#{msg.noRecordsFound}">

	 		 		<p:column headerText="#{msg.operationDate}" style="width:15%">  
		            	<h:outputText value="#{viewUserAccountStateMB.formatDateTime(operation.operationDate)}" />   
	        		</p:column>
	        		
	        		<p:column headerText="#{msg.automatic}" style="width:15%">  
		            	<h:outputText value="#{viewUserAccountStateMB.obtainBooleanDescription(operation.automatic)}" />   
	        		</p:column>  
	        		
	        		<p:column headerText="#{msg.operationType}" style="width:15%">  
		            	<h:outputText value="#{viewUserAccountStateMB.obtainOperationType(operation.operationType)}" />   
	        		</p:column>
	        		
	        		<p:column headerText="#{msg.amount}" style="width:15%">  
		            	<h:outputText value="#{operation.amount}" />   
	        		</p:column>
	        		
	        		<p:column headerText="#{msg.totalAmount}" style="width:15%">  
		            	<h:outputText value="#{viewUserAccountStateMB.getOperationTotalAmount(operation).totalAmount}" />   
	        		</p:column>
	        		
	        		<p:column headerText="#{msg.actions}" style="width:10%">
	        			<center>
		        			<p:commandLink id="viewDetails" action="#{viewUserAccountStateMB.viewDetails(operation)}" ajax="false" process="@form">
			        			<i class="icon-zoom-in icon-2x color-zoom"></i>
			        		</p:commandLink>
	        			</center>
	        		</p:column>
	        		
			    </p:dataTable>	
			   
			    <div style="padding-top:10px; text-align:right">
			    	<r:commandLinkCustom id="back" action="#{viewUserAccountStateMB}" method="doBack" icon="icon-zoom-out" message="#{msg.searchUserAccount}" style="font-size:14px"/>
					<r:commandLinkCustom id="add" action="#{viewUserAccountStateMB}" method="addOperation" icon="icon-money" message="#{msg.addOperation}" style="font-size:14px"/>
				</div>			
			</h:form>		
		</ui:define>
	</ui:composition>
</h:body>
</html>
